package com.example.common.exam;

import com.example.common.pojo.Course;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class Request {
    public void ddd() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
        Course course = new Course();
        course.setCname("dddd");
        Class<Course> courseClass = Course.class;
        Method setCname = courseClass.getMethod("setCname", String.class);
        Object invoke = setCname.invoke(course);
        System.out.println(invoke);
    }
}
